Homework of this week

Classifiers: using a k-Nearest Neighbour, Decision Tree and Random Forest classifier to predict which song belongs to the album it’s from.

Here we have three classifying methodes; kNN, decision tree and random forest, attempting to distinguish the two albums by Frusciante I’m comparing. The most importent features are:

  • Timbre component 1
  • Timbre component 2
  • Timbre component 12
  • loudness
  • energy

The predictions sometimes slightly change (usually by one or two) when I rerun the code, so it is possible the subtext differs from the corresponding heatmap.

K-Nearest Neighbours

***

This heat map shows the performance of a kNN classifier. As you can see, Spotify did a near perfect job on predicting the songs for Niandra LaDes and Usually Just A T-Shirt, but wrongly predicted about a third of the songs for To Record Only Water For Ten Days. I’d love to be able to see which songs were wrongly predicted, anyone know where I can see that?

Decision Tree


This second classifier is done by the decision tree method. The predictions for Niandra LaDes and Usually Just A T-Shirt are apparently the same as the kNN classifier, but it performed better than the kNN when it predicted the songs To Record Only Water For Ten Days, only getting one song wrong.

Random Forest


The last classifier I’m using is the random forest classifier. As you can see it perfomed the best out of the three, getting only one prediction wrong for both albums.

Introduction

How About Some Revalidation Spotify? Comparing the decent and recovery of John Frusciante through music.

John Frusciante is American musician best known as the guitarist of The Red Hot Chili Peppers (RHCP). Besides his work for the RHCP, he has had an accomplished and diverse solo career. In 1992 he left RHCP for the first time and released his debut solo album two years later, in November 1994. The album consists of two parts: Niandra LaDes and Usually Just A T-Shirt. Niandra LaDes was mostly recorded during the writing and recorded of RHCP album Blood Surgar Sex Magic, only “Running Away With You” was recorded after quitting the band. Usually Just A T-Shirt was recorded while the band was on tour in the months leading up to Frusciante’s departure and it appears in the order it was recorded. It was during these months that his use of cocaine and heroin became more extreme. Frusciante said himself in an interview that he can hear his decline into hard drugs in the songs: “It’s very sad because I hear, when I listen to it [the last two songs on the record], that it sounds like a person falling apart or it sounds like somebody about to kill themselves”. It wasn’t until January 1998 that Frusciante was admitted to rehab. He checked out and re-entered society about a month later. The same year Frusciante rejoined RHCP, released a new album with them and went on tour. During the tour he composed new material for his first solo record after rehabilitation, To Record Only Water For Ten Days. What I would like to research in this corpus, is what Spotify’s API can tell us about the differences in his album before rehabilitation, Niandra Lades and Usually Just A T-Shirt (NLDAUJATS), and after rehabilitation, To Record Only Water For Ten Days (TROWFTD).

Comparing both albums

Scatterplot

Histogram of vitality


On the left we have two bar charts, one measuring the valence and one measuring the energy on the two albums. As one would predict after listening to the albums, To Record Only Water For Ten Days beats Niandra Lades and Usually Just A T-Shirt on both accounts, especially in energy. What I find interesting, is that Niandra Lades and Usually Just A T-Shirt has 10 more songs than To Record Only Water For Ten Days, but still loses the fight. This shows how much more energetic and positive Spotify (and I can’t help but agree) finds the latter album.